29 September 2017
Ecosystem structure function (ESF) Species abundance and metabolic rate distributions follow
Spatial structure function (SSF) Spatial abundance distribution and species area relationship follow
install.packages('meteR') # we're live on CRAN!
devtools::install_github('cmerow/meteR') # dev version
library(meteR)
data(arth) head(arth, n = 3)
## spp count mass ## 1 blacchel 1 4.7480 ## 2 mecyocul 1 1.6490 ## 3 eurynsp1 1 0.2584
data(arth) head(arth, n = 3)
## spp count mass ## 1 blacchel 1 4.7480 ## 2 mecyocul 1 1.6490 ## 3 eurynsp1 1 0.2584
arthESF <- meteESF(spp = arth$spp, abund = arth$count,
power = arth$mass^0.75)
arthESF # this is the print method
## METE object with state variables: ## S0 N0 E0 ## 76.00 547.00 15868.26 ## ## with Lagrange multipliers: ## la1 la2 ## 0.037929267 0.004960427
length(unique(arth$spp))
## [1] 76
sum(arth$count)
## [1] 547
sum(arth$mass^0.75 / min(arth$mass^0.75))
## [1] 15868.26
length(unique(arth$spp))
## [1] 76
sum(arth$count)
## [1] 547
sum(arth$mass^0.75 / min(arth$mass^0.75))
## [1] 15868.26
arthESF_stateVar <- meteESF(S0 = 76, N0 = 547, E0 = 15868.26)
data(anbo) head(anbo, n = 3)
## row column spp count ## 1 3 3 cabr 3 ## 2 3 3 caspi1 20 ## 3 3 3 crcr 3
data(anbo) head(anbo, n = 3)
## row column spp count ## 1 3 3 cabr 3 ## 2 3 3 caspi1 20 ## 3 3 3 crcr 3
anboSSF <- meteSSF(spp = anbo$spp, sppID = 'gnwe',
abund = anbo$count, row = anbo$row,
col = anbo$column, A = 1, A0 = 16)
anboSSF
## METE object with state variables: ## n0 A A0 ## 41 1 16 ## ## with Lagrange multipliers: ## [1] 0.3294792
arthSAD <- sad(arthESF)
arthSAD <- sad(arthESF) plot(arthSAD, ptype = 'rad')
arthSAD <- sad(arthESF) plot(arthSAD, ptype = 'rad')
logLik(arthSAD)
## 'log Lik.' -201.8189 (df=2)
anboSAR <- meteSAR(spp = anbo$spp, abund = anbo$count,
row = anbo$row, col = anbo$col,
Amin = 1, A0 = 16)
plot(anboSAR)
anboSAR <- meteSAR(spp = anbo$spp, abund = anbo$count,
row = anbo$row, col = anbo$col,
Amin = 1, A0 = 16)
plot(anboSAR)
mse(anboSAR)
## [1] 29.79903